<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('轮值详情列表')" />
</head>
<body class="gray-bg">
     <div class="col-sm-5">
        <div class="row">
            <div class="col-sm-6 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li class="select-time">
                                <p style="width: 120px" >查询时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="startTime" th:value="${startTime}" />
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" th:value="${endTime}"/>
                            </li>
                            <li>
                                <p style="width: 120px">规则名称：</p>
                                <select id="dutyId" name="dutyId" th:with="duty=${@dutyService.selectDutyList(null)}" style="width:100px">
                                <option th:each="duty : ${duty}" th:text="${duty.name}" th:value="${duty.id}" ></option>
                                 </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

           
            <div class="col-sm-6 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "duty/turns";
        var datas = [[${@dutyTeam.selectDutyTeamList(null)}]];
        $(function() {
            var options = {
                url: prefix + "/getdutyDetail",
                exportUrl: prefix + "/export",
                modalName: "轮值规则",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : '主键',
                    visible: false
                },
                {
                    field : 'times', 
                    title : '开始时间'
                },
                {
                    field : 'class', 
                    title : '班组'
                },
                {
                    field : 'team', 
                    title : '值次',
                    formatter: function(value, row, index) {
		            	return $.table.selectDataLabel(datas, value);
		            }
                }
                
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>